<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Divisores</title>
</head>
<body>

<%!
	public String divisores(int num){
		String divisores = "";
		
		for(int i=1;i<=num;i++){
			
			if(num%i == 0){
				divisores += i+";";
			}
		}
	
		return divisores;
	}

%>

<% 
	String strNum = request.getParameter("numero"); 
	int num = 0;
	if(strNum != null){
		num = Integer.parseInt(strNum);
	}
%>
	
<%  
	if(strNum != null){
%>
		<h1>Divisores de <%= num %></h1>
		<h3><%=divisores(num) %></h3>
<% 	
	
	} 
%>




</body>
</html>